import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import svgLoader from 'vite-svg-loader';

export default defineConfig({
  plugins: [
    vue(),
    svgLoader(
      {
        defaultImport:"raw",
        svgoConfig:{
          multipass: true
        }
      }
    )
  ],
  resolve:{
    alias:{
      '@':"/src"
    }
  },
  base: '/ChatBasedSystemPage.io/',
  server:{
    proxy:{
      "/bingSearchAPI":{
        target:"https://cn.bing.com/",
        changeOrigin:true,
        rewrite: (path)=>path.replace("/bingSearchAPI","")
      },
      "/chatGPTAPI":{
        target:"https://www.13042332817.top/",
        changeOrigin:true,
        rewrite: (path)=>path.replace("/chatGPTAPI",""),
      },
      "/arxivAPI":{
        target:"http://export.arxiv.org/",
        changeOrigin:true,
        rewrite: (path)=>path.replace("/arxivAPI",""),
      },
    }
  },
})
